<template lang="html">
  <!-- 在首页父组件发送http请求,后将数据通过props传递给子组件,可减少请求次数,减少服务器压力 -->
  <div class="index">
    <v-swiper :swiperData="datas.swiper"></v-swiper>
    <div class="fuck_yuanlin"></div>
    <v-section1 :section1="datas.section1"></v-section1>
    <v-section1 :section1="datas.section2"></v-section1>
    <v-baseline></v-baseline>
    <v-footer></v-footer>
  </div>
</template>

<script>
import Header from '@/components/index/header.vue'
import Swiper from '@/components/index/swiper.vue'
import Introduce from '@/components/index/introduce.vue'
import Service from '@/components/index/service.vue'
import Section1 from '@/components/index/section1.vue'
import Section2 from '@/components/index/section2.vue'
import Section3 from '@/components/index/section3.vue'
import Section4 from '@/components/index/section4.vue'
import Baseline from '@/common/_baseline.vue'
import Footer from '@/common/_footer.vue'
import index from '@/http/mock.js' //模拟数据
import { productHome } from '@/api/index'
export default {
  components: {
    'v-header': Header,
    'v-swiper': Swiper,
    'v-introduce': Introduce,
    'v-service': Service,
    'v-section1': Section1,
    'v-section2': Section2,
    'v-section3': Section3,
    'v-section4': Section4,
    'v-baseline': Baseline,
    'v-footer': Footer
  },
  data() {
    return {
      datas: {
        swiper: []
      },
      loading:true
    }
  },
  created () {
    productHome().then(res => {
      if (res.code === 1) {
        let data = res.data
        this.datas.swiper = data.banner
        this.datas.section1 = data.floor1
        this.datas.section2 = data.floor2
      }
    })
  }
}
</script>



<style lang="less" scoped>
.index {
    width: 100%;
    padding-bottom: 14vw;
    background-color: #F8FCFF;
}
</style>
